package cn.com.api.service.impl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.api.entity.ApiU_dynamic_rule;

import cn.com.api.mapper.ApiU_dynamic_ruleMapper;

import cn.com.api.service.ApiU_dynamic_ruleService;
import cn.com.api.service.impl.base.U_dynamic_ruleServiceImplBase;
import cn.com.util.PageInfo;
import cn.com.util.Util;
import cn.com.util.Utils;

/**
 * 
 **/
@Service
public class ApiU_dynamic_ruleServiceImpl extends U_dynamic_ruleServiceImplBase implements ApiU_dynamic_ruleService{
	@Autowired
	private ApiU_dynamic_ruleMapper apiU_dynamic_ruleMapper;
    
	
    //新增对象后返回记录ID
    public int U_dynamic_ruleInsertion(ApiU_dynamic_rule u_dynamic_rule){
        return this.apiU_dynamic_ruleMapper.U_dynamic_ruleInsertion(u_dynamic_rule);
    }
 
    //不看他的动态   不让他看我的动态 
    public List<ApiU_dynamic_rule> dynamic_rule(Map map, PageInfo page)
    {
    	return this.apiU_dynamic_ruleMapper.findU_dynamic_rulesByMapListPage(map, page);
    }
    
    //不看他的动态
    public int notSeeHisDynamics(Map map)
    {
    	this.apiU_dynamic_ruleMapper.deleteDynamicRuleByMap(map);
    	ApiU_dynamic_rule rule = new ApiU_dynamic_rule();
    	rule.setAdd_time(Util.CurrentTime());
    	rule.setUser_id(map.get("user_id").toString());
    	rule.setTo_uid(map.get("to_uid").toString());
    	int ret = apiU_dynamic_ruleMapper.U_dynamic_ruleInsertion(rule);
    	return ret;
    }
}


